package com.fzhucc.modules.businessCard.repository;

import com.fzhucc.modules.businessCard.domain.BusinessCardStatus;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
* @website https://eladmin.vip
* @author yyg
* @date 2022-10-24
**/
public interface BusinessCardStatusRepository extends JpaRepository<BusinessCardStatus, Integer>, JpaSpecificationExecutor<BusinessCardStatus> {

    @Query("SELECT a from BusinessCardStatus as a where a.businessCardId=:businessCardId and a.userId=:userId")
    List<BusinessCardStatus> findByUseridBusinessCardId(Long userId,Integer businessCardId);

    @Query("SELECT a from BusinessCardStatus as a where a.userId=:userId")
    List<BusinessCardStatus> findByUserid(Long userId);
}